﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Model
{
    [Serializable]
    public partial class Sys7a01
    {
		private string _plistid;
		private string _colname;
		private string _sortype;
        private int? _orderid;
		
        /// <summary>
        /// 概要标识
        /// </summary>
		public string Plistid
		{
			get { return _plistid;	 }
			set { _plistid=value;	}
		}
        /// <summary>
        /// 字段
        /// </summary>
		public string Colname
		{
			get { return _colname;	 }
			set { _colname=value;	}
		}
        /// <summary>
        /// A:ASC|D:DESC
        /// </summary>
		public string Sortype
		{
			get { return _sortype;	 }
			set { _sortype=value;	}
		}
        /// <summary>
        /// 顺序
        /// </summary>
		public int? Orderid
		{
			get { return _orderid;	 }
			set { _orderid=value;	}
		}
		
		public static List<Sys7a01> GetSys7a01ListByDataTable(DataTable dt)
		{
			if(dt == null) return null;
		    List<Sys7a01> list = new List<Sys7a01>();
		   
			foreach(DataRow dr in dt.Rows)
            {
				Sys7a01 model = GetSys7a01ByDataRow(dr);
				if(null == model) continue;
				
				list.Add(model);
            }
           return list;
		}
		
		public static Sys7a01 GetSys7a01ByDataRow(DataRow dr)
		{
			Sys7a01 model = new Sys7a01(); //实例化Sys7a01
	
			DataColumnCollection dcc = dr.Table.Columns;

			if (dcc.Contains("plistid")&&!(dr["plistid"] is System.DBNull))  
				model.Plistid = ( string)dr["plistid"];
			if (dcc.Contains("colname")&&!(dr["colname"] is System.DBNull))  
				model.Colname = ( string)dr["colname"];
			if (dcc.Contains("sortype")&&!(dr["sortype"] is System.DBNull))  
				model.Sortype = ( string)dr["sortype"];
			if (dcc.Contains("orderid")&&!(dr["orderid"] is System.DBNull))  
				model.Orderid = ( int)dr["orderid"];
			
			return model;
		}
    }
}
